package com.sctvcloud.dongqu.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ruihang.generalibrary.ui.adapter.BaseHolderAbsAdapter;
import com.ruihang.generalibrary.ui.util.OnItemInternalClick;
import com.sctvcloud.dongqu.R;
import com.sctvcloud.dongqu.beans.NewsItem;
import com.sctvcloud.dongqu.ui.adapter.holder.HomeHotVideoContentHolder;

import java.util.List;

/**
 * Created by Administrator on 2017/7/4 0004.
 */

public class HomeHotVideoContentAdapter extends BaseHolderAbsAdapter<NewsItem, HomeHotVideoContentHolder> {
    public HomeHotVideoContentAdapter(Context context, List<NewsItem> list) {
        super(context, list);
    }

    @Override
    public HomeHotVideoContentHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_home_hot_video_content, parent, false);
        HomeHotVideoContentHolder homeHotVideoContentHolder = new HomeHotVideoContentHolder(context, view);
        homeHotVideoContentHolder.setInternalClick(this);

        return homeHotVideoContentHolder;
    }

    @Override
    public HomeHotVideoContentAdapter setItemInternalClick(OnItemInternalClick itemInternalClick) {
        super.setItemInternalClick(itemInternalClick);
        return this;
    }

    @Override
    public void onBindViewHolder(HomeHotVideoContentHolder holder, int position) {
      //  holder.setOnly(getItemCount()==1);
        super.onBindViewHolder(holder, position);
    }
}
